import axios from 'axios'
import Qs from 'qs'
export function request(config){
	
const instance = axios.create({
	//  baseURL:'http://47.100.181.139:8888/XunYi',
  baseURL:'http://localhost:8080',
  timeout:10000,
	crossDomain:true
});

return new Promise((resolve,reject)=>{
              instance(config).then(res=>{resolve(res)}).catch(err=>{reject(err)})
});
}

export function requestPost(data,url){
	const instance = axios.create({
		////http://47.100.181.139:8888/XunYi
	  baseURL:'http://localhost:8080',
	  timeout:10000,
		crossDomain:true
	});

return new Promise((resolve,reject)=>{
              instance.post(url,Qs.stringify(data)).then(res=>{resolve(res)}).catch(err=>{reject(err)})
});

}


